var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        });
Object.defineProperty(i, "__esModule", {value: !0});
var r = e("Util"),
    s = e("ShopSnakeItem"),
    c = (function (e) {
        function t(o) {
            return e.call(this, t.NAME, o) || this;
        }
        return (
            a(t, e),
            Object.defineProperty(t.prototype, "view", {
                get: function () {
                    return this.viewComponent;
                },
                enumerable: !1,
                configurable: !0
            }),
            (t.prototype.onRegister = function () {
                e.prototype.onRegister.call(this);
            }),
            (t.prototype.listNotificationInterests = function () {
                return [t.CLICK_DECO_AD, t.DECO_TO_SNAKE, t.SKIP_EGG];
            }),
            (t.prototype.handleNotification = function (e) {
                switch (e.getName()) {
                    case t.CLICK_DECO_AD:
                        this.clickDecoAd(e.getBody());
                        break;
                    case t.DECO_TO_SNAKE:
                        this.decoToSnake(e.getBody());
                        break;
                    case t.SKIP_EGG:
                        this.view.skikpEgg();
                }
            }),
            (t.prototype.clickDecoAd = function (e) {
                var t = {isUnlock: e.isUnlock, lockNum: e.lockNum};
                this.view.decorateOtherInfoCache.set(e.index, t),
                    e.isUnlock && r.default.setItem("dressItemLock" + e.index, "true"),
                    r.default.setItem("dressItemLockNum" + e.index, e.lockNum);
            }),
            (t.prototype.decoToSnake = function (e) {
                var t = this.view.snakeScrollview.getCurrentIndexItem().getComponent(s.default).config.index;
                Number(r.default.getItem("dressItemUse" + t, "-1")) === e.decoIndex
                    ? r.default.setItem("dressItemUse" + t, "-1")
                    : r.default.setItem("dressItemUse" + t, e.decoIndex.toString()),
                    this.view.renderSnakeList(this.view.currentThemeIndex, !1),
                    this.view.decorateListView.updateItems();
            }),
            (t.CLICK_DECO_AD = "CLICK_DECO_AD"),
            (t.DECO_TO_SNAKE = "DECO_TO_SNAKE"),
            (t.SKIP_EGG = "SKIP_EGG"),
            (t.NAME = "ShopSkinViewMediator"),
            t
        );
    })(puremvc.Mediator);
i.default = c;
